// 导入axios网络请求库
import axios from "axios";
// 导入接口地址
import api from "./api_address";
// 创建实例时配置默认值
const http = axios.create({ baseURL: "https://apis.netstart.cn/mbcomic" });
// 创建实例后修改默认值
// http.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// 添加响应拦截器
http.interceptors.response.use(
    function (response) {
        // 直接获取响应数据中的data
        return response.data;
    },
    function (error) {
        return Promise.reject(error);
    }
);

// 推荐页轮播图的接口
export const myBanner = (data = {}) => {
    return http.get(api.banner, { params: data });
};
// 推荐页漫画列表接口
export const homeList = (data = {}) => {
    return http.get(api.list, { params: data });
};
//排行页接口
export const myRank = (data = {}) => {
    return http.get(api.rank, { params: data });
};
//分类页接口
export const myClass = (data = {}) => {
    return http.get(api.class, { params: data });
};
//分类页漫画接口
export const myCartoon = (data = {}) => {
    return http.get(api.cartoon, { params: data });
};
//漫画详情接口
export const myDetail = (data = {}) => {
    return http.get(api.detail, { params: data });
};
//热门评论接口
export const myReply = (data = {}) => {
    return http.get(api.reply, { params: data });
};
//猜你喜欢接口
export const myFavorite = (data = {}) => {
    return http.get(api.favorite, { params: data });
};
//漫画章节内容图片&索引
export const myImgIndex = (data = {}) => {
    return http.get(api.imgindex, { params: data });
};
//漫画章节内容图片 Token
export const getImgToken = (data = {}) => {
    return http.get(api.imgToken, { params: data });
};
